package com.blog;

import com.blog.dao.BlogMapper;
import com.blog.dao.BlogtypeMapper;
import com.blog.entity.Blogtype;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import javax.annotation.Resource;
import java.io.InputStream;
import java.util.List;

public class blogtest {
    private InputStream in;
    private SqlSession sqlSession;
    private BlogtypeMapper  BlogtypeMapper;
    @Before
    public void init()throws Exception{
        //
        in = Resources.getResourceAsStream("SqlMapConfig.xml");
        //
        SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(in);
        //
        BlogtypeMapper = sqlSession.getMapper(BlogtypeMapper.class);
    }

}

